package com.samphanie.auiu.admin.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.samphanie.auiu.mbg.model.SysRoleMenu;
import com.samphanie.auiu.mbg.utils.PageUtils;

import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;

/**
 * 角色菜单关联Service接口
 *
 * @author zsy
 * @date 2021-05-18
 */
public interface ISysRoleMenuService extends IService<SysRoleMenu> {
    /**
     * 查询角色菜单关联列表
     *
     * @param query
     * @return 角色菜单关联集合
     */
    List<SysRoleMenu> selectSysRoleMenuList(Map<String, String> query);

    /**
     * 分页业务方法
     *
     * @return IPage
     */
    PageUtils listPage(Map<String, Object> query);

    boolean addRoleMenu(Long roleId, Set<Long> menus);

    List<SysRoleMenu> listByRoleId(Long roleId);

    boolean deleteByRoleId(Long roleId);

    Set<Long> listMenuIdsByRoleIds(Set<Long> roleIds);

    Optional<List<SysRoleMenu>> menuRolesByRoleIds(Set<Long> roleIds);
}
